<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path;
	request.setAttribute("basePath", basePath);
%>
<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>添加公司员工</title>
		<meta name="renderer" content="webkit">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
		<script src="${basePath}/statics/js/jquery.min.js"></script>
		<script type="text/javascript" src="${basePath}/statics/lib/layui/layui.js" charset="utf-8"></script>
		<script type="text/javascript" src="${basePath}/statics/js/xadmin.js"></script>
		<script>
			function dept(){
				var did=$("#select1").val();
				$.post("../sectionajax.action",{deptId:did},function (data){
					var nameOpt = "<option value='' selected='selected'>--请选择--</option>";
					for (var i=0;i<data.length;i++){
						nameOpt+="<option value='"+data[i].id+"' >"+data[i].name+"</option>"
					}
					$('#select2').html(nameOpt);
				})
			}

			function select(){
				var sid=$("#select2").val();
				$.post("../postajax.action",{sectionId:sid},function (data){
					var nameOpt = "<option value='' selected='selected'>--请选择--</option>";
					for (var i=0;i<data.length;i++){
						nameOpt+="<option value='"+data[i].id+"' >"+data[i].name+"</option>"
					}
					$('#select3').html(nameOpt);
				})
			}


		</script>

        <style>
            *{
                margin: 0;
            }
            table {
                border-collapse: collapse;
                border:0;
            }
            td{
                width: 70px;
                height: 30px;
                border:0;
            }
            .c1{
                width: 150px;
                padding: 5px;
                float: left;
                margin-top: 1px;
            }
            input{
                float: left;
                width: 450px;
                height: 34px;
                padding: 0;
            }
            .select{
                width: 454px;
                height: 37px;
            }
            button{
                width: 70px;
                height: 40px;
                background-color: cornflowerblue;
                border: 0;
            }
        </style>

    </head>




    <body>
    <div align="center">
        <br /><br />
        <h1>添加公司员工</h1>
        <br /><br />
        <form action="${basePath}/worker/increase/addworker.action" method="post">
            <input type="hidden" name="companyId" value="${companyId}">
            <table border="1px" width="600px">
                <tr style="text-align: center;">
                    <td bgcolor="#D0E1FB" class="c1">员工电话号码</td>
                    <td><input type="text" name="userTel" autocomplete="off" placeholder="员工电话号码"></td>
                </tr>
                <!--分配部门-->
                <tr style="text-align: center;">
                    <td bgcolor="#D0E1FB" class="c1">分配部门</td>
                    <td>
                        <select class="select" id="select1" name="deptId" onchange="dept()">
                            <c:forEach items="${listDept}" var="dept">
                                <option value="${dept.deptId}" >${dept.deptName}</option>

                            </c:forEach>
                        </select>
                    </td>
                </tr>
                <!--分配科室-->
                <tr style="text-align: center;">
                    <td bgcolor="#D0E1FB" class="c1">分配科室</td>
                    <td>
                        <select class="select" id="select2" name="sectionId" onchange="select()">
                            <option value="">科室</option>
                        </select>
                    </td>
                </tr>
                <!--分配职位-->
                <tr style="text-align: center;">
                    <td bgcolor="#D0E1FB" class="c1">分配职位</td>
                    <td>
                        <select class="select" id="select3" name="postId">
                            <option class="c1" value="西湖区">西湖区</option>
                            <option class="c1" value="余杭区">余杭区</option>
                            <option class="c1" value="拱墅区">临安市</option>
                        </select>
                    </td>
                </tr>

                <tr style="text-align: center;">
                    <td bgcolor="#D0E1FB" class="c1">员工基本薪资</td>
                    <td><input type="text" name="salary" autocomplete="off" placeholder="员工薪资"></td>
                </tr>


            </table>
            <br /><br /><br />
            <div>
                <div>
                    <div>
                        <button type="submit">立即提交</button>
                        <button type="reset">重置</button>
                    </div>
                </div>
            </div>
        </form>
    </div>
    </body>

</html>